// 说说相关类型定义

// 说说表单数据
export interface TalkForm {
  id?: number
  userId?: number
  username?: string
  avatarUrl?: string
  nickname?: string
  content: string
  status?: number
  isTop?: number
  likeCount?: number
  talkPwd?: string
  ip?: string
  ipSource?: string
  address?: string
  weather?: string
  photos?: TalkPhoto[]
  tags?: string[]
}

// 说说照片
export interface TalkPhoto {
  id?: number
  talkId?: number
  url: string
  fileType?: string // 文件类型，如image/jpeg, video/mp4等
  createTime?: string
  updateTime?: string
  createBy?: number
  updateBy?: number
  isDel?: number
}

// 说说列表项（根据后端返回的数据结构）
export interface TalkItem {
  id: number
  userId: number
  username: string
  nickname: string
  avatar: string
  content: string
  status: number
  isTop: number
  likeCount: number
  talkPwd: string | null
  ip: string | null
  ipSource: string | null
  address: string | null
  weather: string | null
  createTime: string
  updateTime: string
  photos: TalkPhoto[]
  tags?: string[]
}

// 说说查询参数
export interface TalkQuery {
  pageNum?: number
  pageSize?: number
  keywords?: string
  status?: number
  tagId?: number
  // 日期筛选
  startTime?: string
  endTime?: string
  // 标签筛选
  tags?: number[]
  tagMode?: 'any' | 'all'
}

// 说说分页数据
export interface TalkPageVO {
  id: number
  content: string
  status: number
  isTop: number
  likeCount: number
  talkPwd: string
  ip: string
  ipSource: string
  address: string
  weather: string
  createTime: string
  updateTime: string
  photos: TalkPhoto[]
  tags: string[]
  user: {
    id: number
    username: string
    nickname: string
    avatarUrl: string
  }
}

// 分页响应（根据后端返回的数据结构）
export interface PageResult<T> {
  list: T[]
  total: number
}

// 标签类型
export interface Tag {
  id: number
  tagName: string
  tagType: number // 1代表说说 2代表文章
  createTime: string
  updateTime: string
}

// 标签选项类型（用于下拉选择）
export interface TagOption {
  label: string
  value: number
}
